package com.kuhnwei.examples.patterns.template;

/**
 * Created by Kuhn on 2017/8/15.
 */
public abstract class Action {

    public static final int EAT = 1;
    public static final int SLEEP = 2;
    public static final int WORK = 5;

    public void command(int flag) {
        switch (flag) {
            case EAT : {
                this.eat();
                break;
            }
            case SLEEP : {
                this.sleep();
                break;
            }
            case WORK : {
                this.work();
                break;
            }
            default:{
                break;
            }
        }
    }

    public void execute() {
        command(EAT);
        command(SLEEP);
        command(WORK);
    }

    public abstract void eat();
    public abstract void sleep();
    public abstract void work();
}
